export function price (value, sign = false) {
  let pr = Number(value).toFixed(2).replace('-', '')
  return pr === 'NaN' ? '' : (sign ? '￥' + pr : pr)
}

export function int2price (value, sign = true) {
  if (value !== undefined) {
    let s = (value / 100).toString().split('.')
    s[1] = s[1] ? s[1].padEnd(2, '0') : '00'
    return sign ? '￥' + s.join('.') : s.join('.')
  } else {
    return ''
  }
}
